import http from '../utils/request'

export const getNewsList = () => {
  return http({
    method:'get',
    url:'/api/getnewslist'
  })
}

export const getNewsInfo = id => {
  return http({
    method:'get',
    url:'/api/getnew/' + id
  })
}

export const getComments = ({ id, pageNo, pageSize }) => {
  return http({
    method:'get',
    url:`/api/getcomments/${id}?pageindex=${pageNo}&limit=${pageSize}`
  })
}

export const postComments = ({ id, content }) => {
  return http({
    method:'post',
    url:`/api/postcomment/${id}`,
    data:{
      content
    }
  })
}